package com.boesch.electroOffice.dataaccess.dao.messerli;

import java.util.List;

import com.boesch.electroOffice.dataaccess.common.IllegalDataAccessException;
import com.boesch.electroOffice.model.messerli.Customer;
import com.liferay.portal.model.User;

/**
 * This interface allocates all methods for Customer.
 * The methods are only called by the business layer.
 * If there is an error on executing the method, a illegalDataAccessException will be thrown.
 * 
 * @author Ralph Koster
 *
 */
public interface CustomerDao {

	/**
	 * Saves a new customer on messerli database.
	 * Complete Javadoc
	 * 
	 * @param Customer customer
	 * @return String returnCode
	 * @throws IllegalDataAccessException
	 */
	public String saveCustomerOnDatabase(Customer customer, User currentUser) throws IllegalDataAccessException;

	/**
	 * Reads a customer by customer id from messerli database.
	 * Complete Javadoc
	 * 
	 * @param int customerId
	 * @return CustomerMesserli customer
	 * @throws IllegalDataAccessException
	 */
	public Customer readCustomerByCustomerId(int customerId) throws IllegalDataAccessException;

	/**
	 * Reads a customer by emailAddress from messerli database.
	 * Complete Javadoc
	 * 
	 * @param String emailAddress
	 * @return CustomerMesserli customer
	 * @throws IllegalDataAccessException
	 */
	public Customer readCustomerByEmailAddress(String emailAddress) throws IllegalDataAccessException;

	/**
	 * Reads a list of customers by name from messerli database.
	 * Complete Javadoc
	 * 
	 * @param String firstname
	 * @param String lastname
	 * @return List<CustomerMesserli> customers
	 * @throws IllegalDataAccessException
	 */
	public List<Customer> readCustomersByName(String firstname, String lastname) throws IllegalDataAccessException;

	/**
	 * Reads all customers from messerli database.
	 * Complete Javadoc
	 * 
	 * @return List<CustomerMesserli> customers
	 * @throws IllegalDataAccessException
	 */
	public List<Customer> readAllCustomers() throws IllegalDataAccessException;

	/**
	 * Reads all Salutations from messerli database.
	 * Complete Javadoc
	 * 
	 * @return List<String> salutations
	 * @throws IllegalDataAccessException
	 */
	public List<String> readAllSalutations() throws IllegalDataAccessException;

	/**
	 * Updates a customer on messerli database.
	 * Complete Javadoc
	 * 
	 * @param Customer customer
	 * @return String returnCode
	 * @throws IllegalDataAccessException
	 */
	public String updateCustomerOnDatabase(Customer customer, User currentUser) throws IllegalDataAccessException;
}
